<template>
	<view class="msg-content-page">
		<view class="content-box">
			<view class="title-box">
				<h2>{{message.title}}</h2>
			</view>
			<view class="content-text">
				<text>{{message.content}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		updateMessage
	} from "../../../api/supervise/index.js"
	export default {
		data() {
			return {
				message: {}
			}
		},
		onLoad(option) {
			if (Object.keys(option).length > 0) {
				const message = JSON.parse(decodeURIComponent(option.message));
				this.message = message;
				if (message.status === 0) {
					this.updateMessage(message.id);
				}
			}

		},
		methods: {
			updateMessage(msgId) {
				updateMessage(msgId).then();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.title-box {
		padding: 1vh 2vh;
		min-height: 10vh;
		height: auto;
		text-align: center;
		border-bottom: solid 1px #939393;

	}

	.content-text {
		padding: 1vh 2vh;
		margin-top: 2vh;
		font-size: 18px;
		text-indent: 2em;
		line-height: 3vh;
	}
</style>